package com.tcm.service;

import com.tcm.entity.Battle;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tcm.entity.bo.BattleRoomCacheBo;
import com.tcm.entity.bo.BattleUserCacheBo;
import com.tcm.entity.resp.PageR;
import com.tcm.entity.vo.BattleHisDetailResp;
import com.tcm.entity.vo.BattleListResp;

import java.util.Map;

/**
* @author Guqier
* @description 针对表【ts_battle(对战记录表)】的数据库操作Service
* @createDate 2023-09-24 14:34:31
*/
public interface BattleService extends IService<Battle> {

    void saveBattle(BattleUserCacheBo userCacheBo, BattleRoomCacheBo roomCacheBo, Boolean isComplete);

    PageR<BattleListResp> getBattleList(String account, Integer pageNum, Integer pageSize);

    Map<String, Integer> getBattleCountAndMinConsumeTime(String account);

    BattleHisDetailResp getBattleDetail(Long id, String account);

    /**
     * 教师分页获取所教学生PK记录
     * @param pageNum 当前页号
     * @param pageSize 页面大小
     * @param account 检索学生账号
     * @param currUserId 当前用户ID
     * @param currAccount 当前用户账号
     * @return PK记录
     */
    PageR<BattleListResp> getBattleListByTeacher(Integer pageNum, Integer pageSize, String account, Long currUserId, String currAccount);

    /**
     * 教师获取PK记录详细信息（无答题记录）
     * @param id PK记录ID
     * @return 详细信息
     */
    BattleHisDetailResp getBattleDetailByTeacher(Long id);
}
